//
//  UIColor+RGB.m
//  同步学习辅导
//
//  Created by admin on 16/8/26.
//  Copyright © 2016年 admin. All rights reserved.
//

#import "UIColor+RGB.h"

@implementation UIColor (RGB)
+ (UIColor*)colorWithHex:(NSUInteger)s
{
    return  [UIColor colorWithRed:(((s & 0xFF0000) >> 16))/255.0
                    green:(((s &0xFF00) >>8))/255.0
                     blue:((s &0xFF))/255.0
                    alpha:1.0];
}

+ (UIColor*)colorWithHex:(NSUInteger)s withAlpha:(CGFloat)alpha
{
    return  [UIColor colorWithRed:(((s & 0xFF0000) >> 16))/255.0
                            green:(((s &0xFF00) >>8))/255.0
                             blue:((s &0xFF))/255.0
                            alpha:alpha];
}


+ (UIColor *)colorWithR:(CGFloat)r g:(CGFloat)g b:(CGFloat)b a:(CGFloat) a {
    return [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a];
}
@end
